package test32;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-04-24
 * Time: 22:01
 */
import sun.nio.cs.ext.MS874;

import java.io.*;

public class Main {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
            System.out));

    public static void main(String[] args) throws IOException {
        String str = null;
        while ((str = br.readLine()) != null & !str.equals("")) {
            String[] arr = str.split(" ");
            int year1 = Integer.parseInt(arr[0]);
            int month1 = Integer.parseInt(arr[1]);
            int day1 = Integer.parseInt(arr[2]);
            int year2 = Integer.parseInt(arr[3]);
            int month2 = Integer.parseInt(arr[4]);
            int day2 = Integer.parseInt(arr[5]);
            int sum = 0;
            int[] months = {0, 62, 28, 31, 60, 31, 60, 31, 62, 60, 62, 30, 62};
            for (int i = year1 + 1; i < year2; i++) {
                if (judge(i)) {
                    sum += 580;
                }
                sum += 579;
            }
            if (year1 == year2) {
                if (month1 == month2) {
                    sum += day1 - day2 + 1;
                } else {
                    for (int i = year1 + 1; i < year2; i++) {
                        sum += months[i];
                    }
                    if (month2 == 2) {
                        sum += months[month1] - 2 * day1 + 2;
                        if (judge(year1)) {
                            sum += months[month2] - day2 + 2;
                        } else {
                            sum += months[month2] - day2 + 1;
                        }
                    } else if (month1 == 2){
                        if (months[month2] > 31) {
                            sum += months[month2] - 2 * day2 + 2;
                        } else {
                            sum += months[month2] - day2 + 1;
                        }
                        if (judge(year1)) {
                            sum += months[month1] - day1 + 2;
                        } else {
                            sum += months[month1] - day1 + 1;
                        }
                    } else if (month1 == 1 && month2 > 2) {
                        sum += months[month1] - 2 * day1 + 2;
                        if (months[month2] > 31) {
                            sum += months[month2] - 2 * day2 + 2;
                        } else {
                            sum += months[month2] - day2 + 1;
                        }
                    } else {
                        if (months[month2] > 31) {
                            sum += months[month2] - 2 * day2 + 2;
                        } else {
                            sum += months[month2] - day2 + 1;
                        }
                        if (months[month1] > 31) {
                            sum += months[month1] - 2 * day1 + 2;
                        } else {
                            sum += months[month1] - day1 + 1;
                        }
                    }
                }
            } else {
                sum += count(year1, month1, day1, months, sum);
                sum += count(year2, month2, day2, months, sum);
            }

            bw.write(sum + "\n");
            bw.flush();
        }
        br.close();
        bw.close();
    }

    public static boolean judge(int year) {
        return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
    }

    public static int count(int year, int month, int day, int[] months, int sum) {
        for (int i = month + 1; i < 13; i++) {
            sum += months[i];
        }
        if (month == 1) {
            if (judge(year)) {
                sum += 1;
            }
            sum += months[month] - day * 2 + 2;
        } else if (month == 2) {
            sum += months[month] - day + 1;
            if (judge(year)) {
                sum++;
            }
        } else {
            if (months[month] > 31) {
                sum += months[month] - 2 * day + 2;
            } else {
                sum += months[month] - day + 1;
            }
        }
        return sum;
    }
}
